<template>
  <div>
    <!-- -->
    <button @click="selfSendMes()">发布信息</button>
  </div>
</template>

<script>
import pubsub from "pubsub-js"
export default {
  name: 'AppSub',
  data() {
    return {
    };
  },

  mounted() {
    
  },

  methods: {
    selfSendMes(){
            //定时发送信息  
            setInterval(()=>{
                pubsub.publish("reciveMes","发送的信息"+Math.random(1,10))
            },1000)

            
    }
  },
};
</script>